//
//  LWSwithCell.m
//  Message
//
//  Created by zhongweiMacPro on 2021/7/18.
//  Copyright © 2021 com.liu.message. All rights reserved.
//

#import "LWSwithCell.h"
#import "CDModelClick.h"
#import "Masonry.h"
#import "UIColor+HEX.h"

@implementation LWSwithCell 

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        self.backgroundColor = [UIColor clearColor];
//        self.c
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    
        [self setupUI];
        
    }
    
    return self;
}


- (void)setupUI {
 
    self.comImg = [UIImageView new];
    self.comImg.layer.cornerRadius = 6;
    self.comImg.layer.masksToBounds = YES;
    self.comImg.userInteractionEnabled = YES;
    self.comImg.backgroundColor = [UIColor colorWithHexString:@"#696969"];
    [self.contentView addSubview:self.comImg];
    
    [self.comImg mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.offset(5);
        make.bottom.offset(-2);
        make.top.offset(2);
        make.right.offset(-5);
        
    }];
    
    self.timeLab = [UILabel new];
    self.timeLab.textColor = [UIColor whiteColor];
    self.timeLab.text = @"2021-08-22 16:01";
    self.timeLab.font = [UIFont boldSystemFontOfSize:11];
    
    [self.comImg addSubview:self.timeLab];
    
    [self.timeLab mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.offset(2);
        make.right.offset(-80);
        make.left.offset(20);
        
        
    }];
    
    
    self.titleLab = [UILabel new];
    self.titleLab.textColor = [UIColor cyanColor];
    self.titleLab.font = [UIFont boldSystemFontOfSize:11];
    
    [self.comImg addSubview:self.titleLab];
    
    [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.offset(16);
        make.right.offset(-80);
        make.left.offset(5);
        
        
    }];
    
    self.tiAccBtn = [UIButton new];
    [self.tiAccBtn setTitle:@"   未替换   " forState:UIControlStateNormal];
    [self.tiAccBtn setTitle:@"   已替换   " forState:UIControlStateSelected];
    self.tiAccBtn.titleLabel.font = [UIFont systemFontOfSize:12];
    [self.tiAccBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    self.tiAccBtn.layer.cornerRadius = 10;
    self.tiAccBtn.layer.masksToBounds = YES;
    self.tiAccBtn.layer.borderWidth = 0.8;
    self.tiAccBtn.layer.borderColor = [UIColor purpleColor].CGColor;
    
    [self.tiAccBtn setTitleColor:[UIColor redColor] forState:UIControlStateSelected];
    
    [self.comImg addSubview:self.tiAccBtn];
    
    [self.tiAccBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.offset(5);
        make.right.offset(-80);
        
        
    }];
    
    self.typeState = [UIButton new];
    [self.typeState setTitle:@"   未拦截   " forState:UIControlStateNormal];
    [self.typeState setTitle:@"   拦截中   " forState:UIControlStateSelected];
    self.typeState.titleLabel.font = [UIFont systemFontOfSize:12];
    [self.typeState setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal];
    self.typeState.layer.cornerRadius = 10;
    self.typeState.layer.masksToBounds = YES;
    self.typeState.layer.borderWidth = 0.8;
    self.typeState.layer.borderColor = [UIColor whiteColor].CGColor;
    
    [self.typeState setTitleColor:[UIColor redColor] forState:UIControlStateSelected];
    
    [self.comImg addSubview:self.typeState];
    
    [self.typeState mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.offset(5);
        make.right.offset(-5);
        
        
    }];

}



@end
